import type { PriceSheet } from '@/core/interfaces/priceSheet'
import { VersionTypeEnum } from '@/core/enums/type'
import { ApproveStatusEnum, StatusEnum } from '@/core/enums/status'
import { ComboPriceNameEnum, ComboPriceTimer } from '@/core/enums/name'

export interface OrderFields {
  comboPriceId: number
  customerId: number
  assessmentPrice?: number
}

export function showOrderBtn(record: Partial<PriceSheet>) {
  return record.status === StatusEnum.PENDING && ApproveStatusEnum.SUCCESS === record.approveStatus
}

export interface VersionItem {
  title: string
  desc: string
  active: boolean
  id: VersionTypeEnum
}

export const BwComboPriceNameKeyMap: Record<ComboPriceTimer, ComboPriceNameEnum> = {
  [ComboPriceTimer.TwoYEAR]: ComboPriceNameEnum.TwoYEAR,
  [ComboPriceTimer.YEAR]: ComboPriceNameEnum.YEAR,
  [ComboPriceTimer.HALF_YEAR]: ComboPriceNameEnum.HALF_YEAR,
  [ComboPriceTimer.QUARTET]: ComboPriceNameEnum.QUARTET,
  [ComboPriceTimer.MONTH]: ComboPriceNameEnum.MONTH
}

export const BwVersionTypeKeyMap: Record<VersionTypeEnum, string> = {
  [VersionTypeEnum.All]: '全部',
  [VersionTypeEnum.Cheap]: '普惠版',
  [VersionTypeEnum.Normal]: '标准版',
  [VersionTypeEnum.Pro]: '高级版'
}
